//
//  UserExtensionCustomerTableViewCell.m
//  XinKaiFa55like
//
//  Created by junseek on 2017/3/24.
//  Copyright © 2017年 55like lj. All rights reserved.
//

#import "UserExtensionCustomerTableViewCell.h"
#import "myLabelCategory.h"
@interface UserExtensionCustomerTableViewCell (){    //
    
    NSIndexPath *tempIndexPath;
    NSDictionary *tempDic;
    
    UIImageView *imageLogo;
    UILabel *lblDate;
    UILabel *lblName;
    
}

@end
@implementation UserExtensionCustomerTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        
       
        imageLogo=[RHMethods imageviewWithFrame:CGRectMake(10, 10, 30, 30) defaultimage:@"newPic"];
        [self addSubview:imageLogo];
        [[Utility Share] viewLayerRound:imageLogo borderWidth:0.5 borderColor:[UIColor clearColor]];
        
        lblName=[RHMethods labelWithFrame:CGRectMake(50, 15, 10, 20) font:fontTitle color:rgbTitleColor text:@""];
        [self addSubview:lblName];
        [lblName lableCopy];
        
        lblDate=[RHMethods labelWithFrame:CGRectMake(50, 15, 10, 20) font:fontTxtContent color:rgbTxtGray text:@""];
        [self addSubview:lblDate];
        
        [self addSubview:[RHMethods lineViewWithFrame:CGRectMake(0, 49.5, kScreenWidth, 0.5)]];
        [self setSelectionStyle:UITableViewCellSelectionStyleGray];
    }
    return self;
}

//内容更新
-(void)setValueForDictionary:(NSDictionary *)dic indexPath:(NSIndexPath *)indexPath type:(NSString *)strType{
    tempIndexPath=indexPath;
    tempDic=dic;
    
    [imageLogo imageWithURL:[dic valueForJSONStrKey:@"icon"] useProgress:NO useActivity:NO ];
    lblDate.text=[[Utility Share] timeToTimestamp:[dic valueForJSONStrKey:@"regtime"]];
    lblName.text=[dic valueForJSONStrKey:@"nickname"];
    float fw=[lblDate sizeThatFits:CGSizeMake(MAXFLOAT, 20)].width;
    lblDate.frame=CGRectMake(kScreenWidth-fw-10, Y(lblDate), fw, 20);
    lblName.frameWidth=X(lblDate)-X(lblName)-5;
    
    //h:50
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
